Possible but unobserved-in-the-wild bug where endpoints could get dropped.
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 27 Jul 2005 19:57:55 +0000 (19:57 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 27 Jul 2005 19:57:55 +0000 (19:57 +0000)
gpsbabel/smplrout.c

index da21456357030d0d4f32b2f3e9abe95341a7ea6e..cfffe54fff024a3110a506a6585d38fd05bb83a7 100644 (file)
@@ -55,7 +55,7 @@ free_xte( struct xte *xte_rec )
        xfree(xte_rec->intermed);
 }
 
-#define HUGEVAL 9e9;
+#define HUGEVAL 2000000000
 
 static struct xte_intermed *tmpprev = NULL;
 static int xte_count = 0;
@@ -112,6 +112,13 @@ compare_xte( const void *a, const void *b )
                          ((struct xte *)b)->distance;
        int priodiff = ((struct xte *)a)->intermed->wpt->route_priority -
                       ((struct xte *)b)->intermed->wpt->route_priority;
+       
+       if (HUGEVAL == ((struct xte *)a)->distance)
+               return -1;
+       
+       if (HUGEVAL == ((struct xte *)b)->distance)
+               return 1;
+
        if ( priodiff < 0 ) return 1;
        if ( priodiff > 0 ) return -1;
        if ( distdiff < 0 ) return 1;